home *** CD-ROM | disk | FTP | other *** search
- Path: btree.is.brooktree.com!usenet
- From: sasha@brooktree.com (Alex Bakaev)
- Newsgroups: comp.lang.c++
- Subject: Re: Forced override?
- Date: Mon, 18 Mar 1996 18:58:21 GMT
- Organization: Brooktree Corporation
- Message-ID: <4ikbl1$4tc@btree.brooktree.com>
- References: <m1ybpgkvpa.fsf@zoger.ipost.com>
- NNTP-Posting-Host: komissar.is.brooktree.com
- X-Newsreader: Forte Free Agent v0.46
-
- bobg@zoger.ipost.com (Bob Glickstein) wrote:
-
- >Quick question: is it possible to declare a virtual member function in
- >such a way that derived classes are *required* to override it? This
- >would have to work for classes both directly and indirectly derived.
-
- >Thanks in advance.
-
- Pure virtual functions are doing just that :
-
- class SomeClass {
- public:
- virtual SomePureFunc() = 0;
- };
-
- class SomeDerived : public SomeClass
- {
- public:
- virtual SomePureFunc();
- };
-
- HTH, Alex
-
-
-